package com.ntty.server;

import com.ntty.factory.HttpPipelineFactory;
import com.ntty.server.handle.HttpServerHandler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

public class HttpServerInitializer  extends ChannelInitializer<SocketChannel> {

	@Override
	protected void initChannel(SocketChannel ch) throws Exception {
		ChannelPipeline pipeline = ch.pipeline();
		HttpPipelineFactory.reg接收方解码器(pipeline);		 
		HttpPipelineFactory.reg消息聚合(pipeline,8192);
		HttpPipelineFactory.reg分块写入(pipeline);
		pipeline.addLast("http-server", new HttpServerHandler());
		
	}

}
